package com.xuecheng.content.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xuecheng.content.model.po.CoursePublish;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 课程发布 Mapper 接口
 * </p>
 *
 * @author 勾新杰
 * @since 2025-02-15
 */
public interface CoursePublishMapper extends BaseMapper<CoursePublish> {

    /**
     * 更新课程下线时间为null
     * @param courseId 课程id
     */
    @Update("update xcplus0107_content.course_publish set offline_date = null where id = #{courseId}")
    void updateOfflineDate(Long courseId);

    /**
     * 查询下架时间超过一个月的课程
     * @return 课程列表
     */
    List<CoursePublish> selectLongTimeOffline(@Param("status") String status);
}
